CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )

PROJECT( QMikinolTest )

FIND_PACKAGE( Qt4 COMPONENTS QtMain QtCore QtGui )

IF( QT4_FOUND )

	IF (MSVC)
		# Set Unicode as character set for Visual Studio projects. By default it's Multi-Byte
		ADD_DEFINITIONS(-DUNICODE -D_UNICODE)
				
		# Set Warning level to 4
		# Commented out because Qt generates lots of warnings...
		#	IF ( CMAKE_CXX_FLAGS MATCHES "/W[0-4]" )
		#		STRING( REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" )
		#	ELSE()
		#		SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4" )
		#	ENDIF()
	ENDIF()

	INCLUDE_DIRECTORIES( ${MikinolLib_SOURCE_DIR} )

	SET	(	SOURCES
			MikinolQImageWidget.h
			MikinolQImageWidget.cpp
			MikinolQCameraWidget.h
			MikinolQCameraWidget.cpp
			MikinolQColorCameraSettingsWidget.h
			MikinolQColorCameraSettingsWidget.cpp
			MikinolQSkeletonTrackingDataWidget.h
			MikinolQSkeletonTrackingDataWidget.cpp
			MikinolQSensorWidget.h
			MikinolQSensorWidget.cpp
			MikinolQSensorManagerWidget.h
			MikinolQSensorManagerWidget.cpp
			MikinolQFaceTrackerTestWidget.h
			MikinolQFaceTrackerTestWidget.cpp
			Main.cpp 
		)

	QT4_WRAP_CPP( HEADERS_MOC MikinolQImageWidget.h )	
	QT4_WRAP_CPP( HEADERS_MOC MikinolQCameraWidget.h )	
	QT4_WRAP_CPP( HEADERS_MOC MikinolQColorCameraSettingsWidget.h )	
	QT4_WRAP_CPP( HEADERS_MOC MikinolQSkeletonTrackingDataWidget.h )	
	QT4_WRAP_CPP( HEADERS_MOC MikinolQSensorWidget.h )	
	QT4_WRAP_CPP( HEADERS_MOC MikinolQSensorManagerWidget.h )
	QT4_WRAP_CPP( HEADERS_MOC MikinolQFaceTrackerTestWidget.h )

	INCLUDE( ${QT_USE_FILE} )
	ADD_DEFINITIONS( ${QT_DEFINITIONS} )

	ADD_EXECUTABLE( ${PROJECT_NAME} WIN32 ${SOURCES} ${HEADERS_MOC} )

	TARGET_LINK_LIBRARIES( ${PROJECT_NAME} MikinolLib )
	TARGET_LINK_LIBRARIES( ${PROJECT_NAME} ${QT_LIBRARIES}) 

ELSE()

	MESSAGE("Qt4 not found. Project ${PROJECT_NAME} skipped")

ENDIF()